/**
 * Created by hmq on 2016/12/14.
 */
(function ($) {
    $.fn.picLook = function (options) {
        var _this = this,
            index = 0;
        var plImgshow = _this.find(".picLookshow .plImg");
        var showimg = _this.find(".picLook");
        var imghtml = _this.find(".picLookshow").html();
        var plImg;
        plImgshow.click(function () {
            $("html,body").css("overflow", "hidden");
            index = $(this).index();
            showimg.prepend(imghtml);
            plImg = showimg.find(".plImg");
            plImg.eq(index).css("opacity", "1");
            showimg.animate({
                top: "0"
            });
        });
        var plClose = showimg.find(".plClose");
        plClose.click(function () {
            showimg.css({
                "top": "-150%"
            });
            plImg.remove();
            $("html,body").css("overflow", "visible");
        });
    }
})(jQuery);